<template>
  <a-modal
    title="选择颜色"
    :width="1200"
    :visible="visible"
    @ok="handleOk"
    @cancel="hide"
    :centered="true"
    okText="提交"
  >
    <!-- <a-checkbox-group v-model="selectTag">
      <a-row>
        <a-col :span="6" v-for="item in list" :key="item.name">
          <a-checkbox :value="item.name">
            {{ item.name }}
          </a-checkbox>
        </a-col>
      </a-row>
    </a-checkbox-group> -->
    <a-radio-group v-model="selectTag" @change="onChange">
      <a-col :span="6" v-for="item in list" :key="item.name">
        <a-radio :value="item.name"> {{ item.name }} </a-radio>
      </a-col>
    </a-radio-group>
  </a-modal>
</template>
<script>
import {
  clothesMakeColor,
  clothesMakeTag,
  clothesRemarkList,
  clothesRemarkDetail,
  clothesSplit,
  clothesAddTag,
  clothesAddColor,
} from '@/api/clothes'
export default {
  props: {
    list: {
      type: Array,
      default: () => [],
    },
    value: {
      type: Array,
      default: () => [],
    },
    cid: '',
  },
  data() {
    return {
      visible: false,
      selectTag: [],
    }
  },
  methods: {
    show() {
      this.selectTag = this.value
      this.visible = true
    },
    hide() {
      this.visible = false
    },
    handleOk() {
      let params = {
        id: this.cid,
        color: this.selectTag,
      }
      console.log(params)
      clothesMakeColor(params).then((res) => {
        this.$message.success('操作成功')
      })
      this.$emit('input', this.selectTag)
      this.hide()
    },
    onChange(e) {
      console.log('radio1 checked', e)
    },
  },
}
</script>
<style scoped lang="less">
/deep/ .ant-radio-group {
  width: 100%;
}
</style>